
// #ifndef VUE3
import Vue from 'vue'
import App from './App'


Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App,
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
import store from './store/store.js'

// 网络请求配置插件
import { $http } from '@escook/request-miniprogram'
uni.$http = $http

$http.baseUrl = 'https://api-hmugo-web.itheima.net'
// 请求拦截器
$http.beforeRequest = function (options) {
  uni.showLoading({
  	title: "玩命加载中"
  })
  return options
}

//响应拦截器
$http.afterRequest = function (res) {
  uni.hideLoading()
  return res.data
}

// 弹框方法
uni.$showMsg = function (title = '请求失败', duration = 1200) {
	uni.showToast({
		title: title,
		duration: duration,
		icon: 'none'
	})
}

export function createApp() {
  const app = createSSRApp(App)
  app.use(store)
  return {
    app
  }
}
// #endif